<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div id="app">

    <h2>{{msg}}</h2>
<hr>
<h2>{{revers}}</h2>
<hr>
<span>{{this.num1*1 + this.num2*1 +this.num3*1}}</span>
<input type="text" v-model='num3'>
<input type="text" v-model='num2'>
<input type="text" v-model='msg'>

<hr>
<h1>{{aaa()}}</h1>
<span>{{add}}</span>
  </div>
  <script src="./vue.js"></script>
  <script>
    var vm = new Vue({
      el:'#app',
      data:{
          msg: 'hello Vue',
          num1: 1,
          num2: 2,
          num3: 3
      },
      methods: {
        aaa() {
            console.log(this.num1);
            console.log(this.msg)
            return '你好 aaa 方法'
        }
      },
      computed: {
          revers() {
              return this.msg.split("").reverse().join("")
          },
          add() {
              console.log('add')
              return this.num1*1 + this.num2*1 +this.num3*1
          }
      }
     });
  </script>
</body>
</html>
